<div id="vj_left">
    <?php
    foreach (Yii::app()->user->getFlashes() as $key => $message) {
        echo '<div style="color:blue;font-weight:bold;display:none" class="flash-' . $key . '">' . $message . "</div>\n";
    }
    ?>
    <script type="text/javascript">
        var $html = $(".flash-success").html();
        if ($.trim($html) != '' && $html != undefined) {
            alert($html);
        }
    </script>
    <div class="product-detail-wrapper">
        <?php if ($parent != null && $category != null) { ?>
            <h3> <?php echo $parent->cat_name ?> >
                <a style="color: #3952A2"
                   href="<?php echo TreTodayUrl::getCategoryUrl($category->cat_id, $category->cat_name) ?>">
                    <?php echo $category->cat_name ?>
                </a>
            </h3>
        <?php } ?>

        <div>
            <h3 style="padding: 10px 0px">
                <?php echo $model->product_name ?></h3>

            <?php if ($model->description != '') { ?>
            <p><?php echo $model->description ?> - Giá: <?php echo $model->getPrice() ?><br/>
                <?php } ?>

                <?php if ($model->detail != '') { ?>
                    <?php echo $model->detail ?>
                <?php } ?>
                <?php if ($model->description == '') { ?>

            <p style="padding-bottom: 5px">Giá: <?php echo $model->getPrice() ?></p>
        <?php } ?>
            <?php if ($model->buy_method != null && $model->buy_method->buy_method_name != 'Cách khác') { ?>
            <p>Phương thức giao hàng: <?php echo $model->buy_method->buy_method_name ?><br/>
                <?php } ?>

                <?php if ($model->nick_ym != null && trim($model->nick_ym) != '') { ?>

            <p style="padding-bottom: 5px"> Nick yahoo: <a href="ymsgr:sendIM?{'<?php echo $model->nick_ym ?>'}">
                    <img border="0"
                         title="<?php echo $model->nick_ym ?> - yahoo.com"
                         alt="<?php echo $model->nick_ym ?> - yahoo.com"
                         src="http://opi.yahoo.com/online?u='<?php echo $model->nick_ym ?>
            .'&amp;m=g&amp;t=StyleID"/> <?php echo $model->nick_ym ?></a><br/></p>
        <?php } ?>
            <?php if ($model->nick_skype != null && trim($model->nick_skype) != '') { ?>
                <p style="padding-bottom: 5px"> Nick skype: <a
                        href="skype:<?php echo $model->nick_skype ?>?chat"><?php echo $model->nick_skype ?></a>
                    <br/></p>
            <?php } ?>
            <?php if ($model->website != null && trim($model->website) != '') { ?>
                <p style="padding-bottom: 5px"> Website: <?php echo $model->website ?><br/></p>
            <?php } ?>

            <?php if ($model->add_time != '') {
                echo "<p>Ngày tạo: " . TreTodayCommon::formatDate($model->add_time) . "</p>";
            } ?>
        </div>

        <?php if (strlen($model->detail) < 5000 && count($related_products) > 0) { ?>
            <div class="related-product-wrapper">

                <h3 style="margin-bottom: 5px"> Các sản phẩm liên quan</h3>
                <?php foreach ($related_products as $item) { ?>
                    <div>» <a href="<?php echo TreTodayUrl::getProductUrl($item->product_id, $item->product_name) ?>">
                            <?php echo $item->product_name ?>
                        </a>
                    </div>
                <?php } ?>
            </div>
        <?php } ?>
    </div>

</div>
<div id="vj_right">
    <?php $this->widget('WidgetUserInfo', array('user_id' => $model->user_id));
    $this->widget('WidgetUserProducts', array('user_id' => $model->user_id, 'product_id' => $model->product_id))
    ?>
</div>